<?php

/**
 * @file
 * Theme settings .
 */

function solveto_theme_settings_text(&$form, &$form_state) {
    global $base_url;
    $theme_path = drupal_get_path('theme','solveto');
    $form['solveto_settings']['text'] = array(
        '#type' 					=> 'fieldset',
        '#prefix'  				=> '<div id="sf-text-typography">',
        '#suffix'        => '</div><!-- / #sf-text-typography -->',
    );

    /* 3.	Custom font
       --------------------------------------------------------------------------*/
    $form['solveto_settings']['text']['custom_font'] = array(
        '#type' 					=> 'fieldset',
        '#weight' 				=> 1,
        '#prefix' => '  <div id="custom-font">   <div class="widget">
                        <div class="title">
                            <img src="'.$base_url.'/'.$theme_path.'/img/theme-settings/images/icons/dark/preview.png" alt="" class="titleIcon">
                            <h6>Custom Fonts</h6>
                        </div>
                        ',
        '#suffix'       => '</div></div>',
    );
    $form['solveto_settings']['text']['custom_font']['googlewebfonts'] = array(
        '#type' 					=> 'textarea',
        '#resizable' => FALSE,
        '#rows' => 6,
        '#default_value' 	=>  theme_get_setting('googlewebfonts','solveto') ? theme_get_setting('googlewebfonts','solveto') :'https://fonts.googleapis.com/css?family=Istok+Web|Open+Sans:400,300,600,700,800',
        '#prefix'   =>  '
        <div class="formRow"><label><ul class="steps">
            <li>Go to <a href="http://www.google.com/webfonts" target="_blank">www.google.com/webfonts</a>, choose your fonts and add to collection</li>
            <li>Click &quot;Use&quot; in the bottom bar after choose fonts</li>
            <li>Find &quot;Integrate the fonts into your CSS&quot;, copy link like our example from that field and paste it below to activate.</li>
        </ul></label>',
        '#suffix'   => '</div>',
        '#field_prefix' => '<div class="formRight">',
        '#field_suffix' => '</div>',
        '#attribute'    => array(
            'placeholder'     => array(
                'http://fonts.googleapis.com/css?family=Istok+Web|Open+Sans:400,300,600,700,800'
            )
        )
    );

    /* 1.	Text & link style
    --------------------------------------------------------------------------*/
    $form['solveto_settings']['text']['text_normal'] = array(
        '#type' 					=> 'fieldset',
        '#weight' 				=> 2,
        '#prefix' => '  <div id="tt-text">   <div class="widget">
                        <div class="title">
                            <img src="'.$base_url.'/'.$theme_path.'/img/theme-settings/images/icons/dark/preview.png" alt="" class="titleIcon">
                            <h6>Custom Text For Sites</h6>
                        </div>
                        ',
        '#suffix'       => '</div></div>',
    );

    // Text
    $form['solveto_settings']['text']['text_normal']['text_style'] = array(
        '#type' 					=> 'fieldset',
        '#prefix' => '     <div class="widget sub-widget">
                        <div class="title">
                            <img src="'.$base_url.'/'.$theme_path.'/img/theme-settings/images/icons/dark/preview.png" alt="" class="titleIcon">
                            <h6>Text Style</h6>
                        </div>
                        ',
        '#suffix'       => '</div>',
    );

    $form['solveto_settings']['text']['text_normal']['text_style']['text_font'] = array(
        '#type'          	=> 'hidden',
        '#default_value' 	=> theme_get_setting('text_font','solveto'),
        '#prefix' => '<div id="text-font" class="choosefont clearfix">',
        '#suffix' => '</div>',
    );

    $form['solveto_settings']['text']['text_normal']['text_style']['ts_font_color'] = array(
        '#type'          	=> 'textfield',
        '#default_value' 	=> theme_get_setting('ts_font_color','solveto'),
        '#attributes' 		=> array(
            'class' => array(
                'form-colorpicker',
            ),
        ),
        '#prefix'   =>  '<div class="formRow"><label>Color</label>',
        '#suffix'   => '</div>',
        '#field_prefix' => '<div class="formRight">',
        '#field_suffix' => '</div>',
    );

    // Text selection
    $form['solveto_settings']['text']['text_normal']['text_selection'] = array(
        '#type' 					=> 'fieldset',
        '#prefix' => '     <div class="widget sub-widget">
                        <div class="title">
                            <img src="'.$base_url.'/'.$theme_path.'/img/theme-settings/images/icons/dark/preview.png" alt="" class="titleIcon">
                            <h6>Text Selection</h6>
                        </div>
                        ',
        '#suffix'       => '</div>',
    );

    $form['solveto_settings']['text']['text_normal']['text_selection']['tss_bgcolor'] = array(
        '#type'          	=> 'textfield',
        '#default_value' 	=> theme_get_setting('tss_bgcolor','solveto'),
        '#attributes' 		=> array(
            'class' => array(
                'form-colorpicker',
            ),
        ),
        '#prefix'   =>  '<div class="formRow"><label>Background color</label>',
        '#suffix'   => '</div>',
        '#field_prefix' => '<div class="formRight">',
        '#field_suffix' => '</div>',
    );

    $form['solveto_settings']['text']['text_normal']['text_selection']['tss_tcolor'] = array(
        '#type'          	=> 'textfield',
        '#default_value' 	=> theme_get_setting('tss_tcolor','solveto'),
        '#attributes' 		=> array(
            'class' => array(
                'form-colorpicker',
            ),
        ),
        '#prefix'   =>  '<div class="formRow"><label>Text color</label>',
        '#suffix'   => '</div>',
        '#field_prefix' => '<div class="formRight">',
        '#field_suffix' => '</div>',
    );


    /* 2.	Typography
    --------------------------------------------------------------------------*/
    $form['solveto_settings']['text']['text_typography'] = array(
        '#type' 					=> 'fieldset',
        '#weight' 				=> 3,
        '#prefix' => '  <div id="tt-typography">   <div class="widget">
                        <div class="title">
                            <img src="'.$base_url.'/'.$theme_path.'/img/theme-settings/images/icons/dark/preview.png" alt="" class="titleIcon">
                            <h6>Typography Custom</h6>
                        </div>
                        ',
        '#suffix'       => '</div></div>',
    );

    $form['solveto_settings']['text']['text_typography']['typo_heading_style_enable'] = array(
        '#type'          => 'checkbox',
        '#default_value' => theme_get_setting('typo_heading_style_enable','solveto') ? theme_get_setting('typo_heading_style_enable','solveto') : 0,
        '#attributes'   => array(
            'class' => array('input-checkbox')
        ),
        '#prefix'   =>  '<div class="formRow"><label>Heading Custom</label>',
        '#suffix'   => '</div>',
        '#field_prefix' => '<div class="formRight">',
        '#field_suffix' => '</div>',
    );
    $form['solveto_settings']['text']['text_typography']['typo_heading_settings'] = array(
        '#type'                 =>  'container',
        '#states'           => array(
            'visible'       => array(
                ':input[name="typo_heading_style_enable"]' => array(
                    'checked'     => TRUE
                )
            )
        ),

    );
    for($i=1;$i<=6;$i++){
        $form['solveto_settings']['text']['text_typography']['typo_heading_settings']['typo_heading_h'.$i.''] = array(
            '#type' 					=> 'fieldset',
            '#prefix' => '     <div class="widget sub-widget">
                        <div class="title">
                            <img src="'.$base_url.'/'.$theme_path.'/img/theme-settings/images/icons/dark/preview.png" alt="" class="titleIcon">
                            <h6>Heading '.$i.'</h6>
                        </div>
                        ',
            '#suffix'       => '</div>',
        );
        $form['solveto_settings']['text']['text_typography']['typo_heading_settings']['typo_heading_h'.$i.'']['typo_heading_h'.$i.'_style'] = array(
            '#type'          	=> 'hidden',
            '#default_value' 	=> theme_get_setting('typo_heading_h'.$i.'_style','solveto'),
            '#prefix' => '<div id="typo_heading_h'.$i.'_style" class="choosefont clearfix">',
            '#suffix' => '</div>',
        );

        $form['solveto_settings']['text']['text_typography']['typo_heading_settings']['typo_heading_h'.$i.'']['typo_heading_h'.$i.'_color'] = array(
            '#type'          	=> 'textfield',
            '#default_value' 	=> theme_get_setting('typo_heading_h'.$i.'_color'),
            '#attributes' 		=> array(
                'class' => array(
                    'form-colorpicker',
                ),
            ),
            '#prefix'   =>  '<div class="formRow"><label>Color</label>',
            '#suffix'   => '</div>',
            '#field_prefix' => '<div class="formRight">',
            '#field_suffix' => '</div>',
        );
    }

}
